﻿<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Site.Master" CodeBehind="stores.aspx.vb" Inherits="prueba.WebForm9" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table id="table1" style="width:100%;">
    <tr>
        <td>
            <asp:GridView ID="GridView1" runat="server" DataSourceID="storesSqlDataSource1" 
                AutoGenerateColumns="False" DataKeyNames="stor_id">
                <Columns>
                    <asp:BoundField DataField="stor_id" HeaderText="stor_id" ReadOnly="True" 
                        SortExpression="stor_id" />
                    <asp:BoundField DataField="stor_name" HeaderText="stor_name" 
                        SortExpression="stor_name" />
                    <asp:BoundField DataField="stor_address" HeaderText="stor_address" 
                        SortExpression="stor_address" />
                    <asp:BoundField DataField="city" HeaderText="city" SortExpression="city" />
                    <asp:BoundField DataField="state" HeaderText="state" 
                        SortExpression="state" />
                    <asp:BoundField DataField="zip" HeaderText="zip" SortExpression="zip" />
                </Columns>
            </asp:GridView>
            <asp:SqlDataSource ID="storesSqlDataSource1" runat="server" 
                ConnectionString="<%$ ConnectionStrings:pubsConnectionString19 %>" 
                DeleteCommand="DELETE FROM [stores] WHERE [stor_id] = @stor_id" 
                InsertCommand="INSERT INTO [stores] ([stor_id], [stor_name], [stor_address], [city], [state], [zip]) VALUES (@stor_id, @stor_name, @stor_address, @city, @state, @zip)" 
                SelectCommand="SELECT * FROM [stores]" 
                
                UpdateCommand="UPDATE [stores] SET [stor_name] = @stor_name, [stor_address] = @stor_address, [city] = @city, [state] = @state, [zip] = @zip WHERE [stor_id] = @stor_id">
                <DeleteParameters>
                    <asp:Parameter Name="stor_id" Type="String" />
                </DeleteParameters>
                <InsertParameters>
                    <asp:ControlParameter ControlID="TxtBox1stor_id" Name="stor_id" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox2stor_name" Name="stor_name" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox3stor_address" Name="stor_address" 
                        PropertyName="Text" Type="String" />
                    <asp:ControlParameter ControlID="TxtBox4city" Name="city" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox5state" Name="state" PropertyName="Text" 
                        Type="String" />
                    <asp:ControlParameter ControlID="TxtBox6zip" Name="zip" PropertyName="Text" 
                        Type="String" />
                </InsertParameters>
                <UpdateParameters>
                    <asp:Parameter Name="stor_name" Type="String" />
                    <asp:Parameter Name="stor_address" Type="String" />
                    <asp:Parameter Name="city" Type="String" />
                    <asp:Parameter Name="state" Type="String" />
                    <asp:Parameter Name="zip" Type="String" />
                    <asp:Parameter Name="stor_id" Type="String" />
                </UpdateParameters>
            </asp:SqlDataSource>
        </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label1" runat="server" Text="stor_id"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox1stor_id" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label2" runat="server" Text="stor_name"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox2stor_name" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label3" runat="server" Text="stor_address"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox3stor_address" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td style="font-weight: 700">
                    <asp:Label ID="Label4" runat="server" Text="city"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox4city" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label5" runat="server" Text="state"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox5state" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Label ID="Label6" runat="server" Text="zip"></asp:Label>
&nbsp;
                    <asp:TextBox ID="TxtBox6zip" runat="server"></asp:TextBox>
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
    <tr>
        <td>
                    <asp:Button ID="Button1" runat="server" Text="Enviar" />
                    <asp:Button ID="Button2" runat="server" Text="BORRAR" style="height: 26px" />
                </td>
        <td>
            &nbsp;</td>
        <td>
            &nbsp;</td>
    </tr>
</table>
</asp:Content>
